import React, { useState, useEffect } from 'react';
import styles from './index.less';

import { Button } from 'antd';
import { useAuth0 } from '@auth0/auth0-react';

export default function() {
  const { loginWithRedirect, isAuthenticated } = useAuth0();

  useEffect(() => {
    setTimeout(() => {
      console.log(isAuthenticated);
    }, 2000);
  }, []);

  return (
    <div>
      <Button onClick={() => loginWithRedirect()}>登录 Auth0</Button>
    </div>
  );
}
